using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace Sandia.MVCFramework.Common
{
    /// <summary>
    /// A custom IComparere for DirectoryInfos. 
    /// This compares the directory names.
    /// </summary>
    public class DirectoryInfoComparer : IComparer<DirectoryInfo>
    {
        #region IComparer<DirectoryInfo> Members

        /// <summary>
        /// Compares the provided DirectoryInfos.
        /// </summary>
        /// <param name="x">A DirectoryInfo to compare.</param>
        /// <param name="y">A DirectoryInfo to compare.</param>
        /// <returns>
        /// Less than 0, x is less than y. Greater than 0, x is greater than y.
        /// 0, they are equal.
        /// </returns>
        public int  Compare(
            DirectoryInfo x, 
            DirectoryInfo y)
        {
 	        return String.Compare(x.Name, y.Name);
        }

        #endregion
    }
}
